package com.example.Exception;

public class Throwable {
    public static void main(String[] args) {
        try {
            int[] arr = {1, 2, 3, 4, 5};
            System.out.println(arr[10]);
        } catch (Exception e) {
            String message = e.getMessage();
            System.out.println(message);    //Index 10 out of bounds for length 5\
            String s = e.toString();
            System.out.println(s);  //java.lang.ArrayIndexOutOfBoundsException: Index 10 out of bounds for length 5
            e.printStackTrace();    //打印错误信息
        }

        System.out.println("嘿嘿嘿嘿");

    }
}
